package com.fuxi.cloud.desreport.dao;

import com.fuxi.cloud.common.vo.JmDictModel;
import com.fuxi.cloud.desreport.entity.JimuReport;
import com.fuxi.cloud.desreport.entity.JmReportDbParam;
import com.fuxi.cloud.desreport.model.JmExpBacker;
import org.jeecgframework.minidao.annotation.Param;
import org.jeecgframework.minidao.annotation.ResultType;
import org.jeecgframework.minidao.annotation.Sql;
import org.jeecgframework.minidao.pojo.MiniDaoPage;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * JimuReportDao
 *
 * @Author: 扫地僧
 * @CreateTime: 2021-05-03
 */
@Repository
public interface JimuReportDao {
    @Sql("SELECT * FROM jimu_report WHERE ID = :id")
    JimuReport get(@Param("id") String var1);

    int update(@Param("jimuReport") JimuReport var1);

    void insert(@Param("jimuReport") JimuReport var1);

    @ResultType(JimuReport.class)
    MiniDaoPage<JimuReport> getAll(@Param("jimuReport") JimuReport var1, @Param("page") int var2, @Param("rows") int var3);

    @Sql("DELETE from jimu_report WHERE ID = :id")
    void delete(@Param("id") String var1);

    @Sql("DELETE from jimu_report WHERE ID = :id")
    void deleteById(@Param("id") String var1);

    @Sql("SELECT COUNT(name) FROM jimu_report WHERE del_flag = '0' AND name = :name")
    Integer excelQueryName(@Param("name") String var1);

    @ResultType(JmReportDbParam.class)
    List<JmReportDbParam> queryReportParam(@Param("reportId") String var1);

    @ResultType(JmDictModel.class)
    List<JmDictModel> queryDictBySql(@Param("dictCode") String var1);

    @ResultType(JimuReport.class)
    @Sql("select id,name from  jimu_report where create_by=:username and id!=:reportId")
    List<JimuReport> getReportByUser(@Param("username") String var1, @Param("reportId") String var2);

    @ResultType(JmExpBacker.class)
    JmExpBacker queryExpValue(@Param("expFullSql") String var1);

    @ResultType(JimuReport.class)
    MiniDaoPage<JimuReport> pageList(@Param("jimuReport") JimuReport var1, @Param("page") int var2, @Param("rows") int var3);
}

